package chapter20;

import java.util.Comparator;

public class StuScoreComparator implements Comparator<StuScore> {

    @Override
    public int compare(StuScore o1, StuScore o2) {
        double score1 = o1.getScore();
        double score2 = o2.getScore();

        if (score1>score2)
            return 1;
        else if (score1<score2)
            return -1;
        else
            return 0;
    }
}
